<template>
  <div>
    detail
    <p>{{ $store.state.number }}</p>
    <button @click="plus">plus</button>
  </div>
</template>

<script>
export default {
  asyncData({ store, route }) {
    // 触发 action 后，会返回 Promise
    return store.dispatch('GET_NUMBER', 10)
  },
  methods: {
    plus() {
      this.$store.commit('SET_NUMBER', this.$store.state.number + 1)
    }
  }
}
</script>